package com.charlotte.study.gupao.proxy.dynamicproxy.Djjproxy.client;

import com.alibaba.fastjson.JSON;
import com.charlotte.study.gupao.proxy.dynamicproxy.Djjproxy.DjjMeipo;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * @author junjie.ding
 * @date 2020/3/3
 */
public class main {
    public static void main(String[] args) throws IOException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        Zhangsan zhangsan = new Zhangsan();
        DjjMeipo meipo = new DjjMeipo();
        IPerson instance = meipo.getInstance(zhangsan);
        List instanceLove = instance.findLove("我的条件：温柔可人", 5);
        System.out.println("找到候选人：" + JSON.toJSONString(instanceLove));

        String chooseOne = zhangsan.chooseOne("小白");
        System.out.println("张三选择了：" + chooseOne);

//        byte[] generateProxyClass = ProxyGenerator.generateProxyClass("$proxy0", new Class[]{IPerson.class});
//
//        FileOutputStream fos = new FileOutputStream("D:\\download\\gupaoedu-vip-pattern-proxy\\gupaoedu-vip-pattern-proxy\\src\\main\\java\\com\\gupaoedu\\vip\\pattern\\proxy\\dbroute\\$proxy0.class");
//
//        fos.write(generateProxyClass);
//        fos.flush();
//        fos.close();

    }
}
